<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>主页面</title>
<style type="text/css">
table.gridtable {
	font-family: verdana, arial, sans-serif;
	font-size: 11px;
	color: #333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}

table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #dedede;
}

table.gridtable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
}

tr:hover td {
	background: none;
}

tr:hover {
	background-color: none;
}

thead th {
	position: sticky;
	top: 0;
	z-index: 1;
}

table {
	border-collapse: collapse;
	width: 100%;
}

th, td {
	padding: 8px;
	text-align: left;
}

th {
	background-color: #f2f2f2;
}

#myDiv1{
	background-color: #f1f1f1;
	padding: 10px;
}
#myDiv2{
	background-color: #f1f1f1;
	padding: 10px;
}

#myDiv3{
	background-color: #f1f1f1;
	padding: 10px;
}


.popup {
	width: 1000px;
	height: 700px;
	background-color: #f1f1f1;
	border: 1px solid #ccc;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.close-btn {
	position: absolute;
	top: 0;
	right: 0;
	padding: 10px;
	cursor: pointer;
	font-size: 20px;
	color: #aaa;
}
</style>
<meta charset="UTF-8">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/grid1.0.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/echarts.min.js"></script>
</head>
<body>

	<input type="text" id="text1">
	<button id="button_17">启动首版监控</button>
	<button id="button_18">计算符合首板要求的股票</button>
	<div id="div2-3"></div>
	<div id="div2-4"></div>
	<div id="div1"></div>
	<div id="myDiv" style="width:30%;float:left;text-align: center;">一分钟</div>
	<div id="myDiv" style="width:30%;float:left;text-align: center;">三分钟</div>
	<div id="myDiv" style="width:30%;float:left;text-align: center;">五分钟</div>
	<div id="myDiv1" style="width:30%;float:left"></div>
	<div id="myDiv2" style="width:30%;float:left"></div>
	<div id="myDiv3" style="width:30%;float:left"></div>
	<div class="popup" style="display: none; overflow-y: auto;">
		<!-- 这里可以添加你的内容 -->
		<span class="close-btn" id="san1">×</span>
		<div style="width: 1000px; height: 800px; margin-top: 40px;" id="mainechar"></div>

	</div>

	<script type="text/javascript">

(function(){
	$("#button_17").click(function(){
		 
		aaa();
	});
	
	setInterval(function(){
		
		bbb1();
		bbb2();
		bbb3();
		$("td[name='czzdf']").each(function() {
	        var num = parseFloat($(this).text());
	        if (!isNaN(num)) {
	        	if(num >0){
	        		$(this).css('color','red');
	        	}else{
	        		$(this).css('color','green');
	        	}
	        	$(this).text(num.toFixed(2));
	        }
	    });
		$("td[name='zdf']").each(function() {
	        var num = parseFloat($(this).text());
	        if (!isNaN(num)) {
	        	if(num >0){
	        		$(this).css('color','red');
	        	}else{
	        		$(this).css('color','green');
	        	}
	        	$(this).text(num.toFixed(2));
	        }
	    });
		  $('#mytalbe tr:first td:eq(0)').text('编号');
		  $('#mytalbe tr:first td:eq(1)').text('时概念');
		  $('#mytalbe tr:first td:eq(2)').text('代码');
		  $('#mytalbe tr:first td:eq(3)').text('总体涨跌值');
		  $('#mytalbe tr:first td:eq(4)').text('时时涨跌值'); 
		  
		  $('#mytable2 tr:first td:eq(0)').text('编号');
		  $('#mytable2 tr:first td:eq(1)').text('时概念');
		  $('#mytable2 tr:first td:eq(2)').text('代码');
		  $('#mytable2 tr:first td:eq(3)').text('总体涨跌值');
		  $('#mytable2 tr:first td:eq(4)').text('时时涨跌值');
		  
		  $('#mytable3 tr:first td:eq(0)').text('编号');
		  $('#mytable3 tr:first td:eq(1)').text('时概念');
		  $('#mytable3 tr:first td:eq(2)').text('代码');
		  $('#mytable3 tr:first td:eq(3)').text('总体涨跌值');
		  $('#mytable3 tr:first td:eq(4)').text('时时涨跌值');
		  
		  mytable2
	},10000);
	
	$("#button_18").click(function(){ 
		 $.ajax({
				type : "get",
				url : "${pageContext.request.contextPath}/topShouban",
				dataType : 'text', 
				data:{text1:$("#text1").val()},
				success : function(msg) { 
				  alert(1);
				} 
			});  
	});
	
	function bbb1(){
		
		 $.ajax({
				type : "get",
				url : "${pageContext.request.contextPath}/getTopBanList1",
				dataType : 'text', 
				async:false,
				data:{text1:$("#text1").val()},
				success : function(msg) { 
					$("#myDiv1").html(msg);
					$("#mytalbe").addClass("gridtable");  
					 //duidiao1();
					 
					
				} 
			}); 
	}
	function bbb2(){
		
		 $.ajax({
				type : "get",
				url : "${pageContext.request.contextPath}/getTopBanList3",
				dataType : 'text',
				async:false,
				data:{text1:$("#text1").val()},
				success : function(msg) { 
					let newStr = msg.replace('mytalbe','mytable2');
					$("#myDiv2").html(newStr);
					$("#mytable2").addClass("gridtable");  
					 
					// duidiao2();
				} 
			}); 
	}
	function bbb3(){
		
		 $.ajax({
				type : "get",
				url : "${pageContext.request.contextPath}/getTopBanList5",
				dataType : 'text', 
				async:false,
				data:{text1:$("#text1").val()},
				success : function(msg) {
					let newStr = msg.replace('mytalbe','mytable3');
					$("#myDiv3").html(newStr);
					$("#mytable3").addClass("gridtable");  
					 
					 //duidiao3();
				} 
			}); 
	}
	
	 
	
 
	function aaa(){
		var text17 = $("#text1").val(); 
		 $.ajax({
				type : "get",
				url : "${pageContext.request.contextPath}/getTopShouban",
				dataType : 'text', 
				data:{text1:$("#text1").val()},
				success : function(msg) { 
				 alert(1);
					 
				} 
			}); 
	}
	 
	
	
	 
})();
</script>
</body>
</html>